package Test2;

import Test3.Main;

class A {
    String name;
    int age;
    public A() {

    }
    public A(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void B(int age) {

    }
}
class B extends A {
    String name;
    int age;
    public void A(String name,int age,int weight) {

    }
    public B() {
    }
    public B(String name, int age) {
        super(name,age);
        this.name = name;
        this.age = age;

    }
}
public class Main1{
//不同包中的子类
public static void main(String[] args) {
    Main p=new Main();

    System.out.println(p.a);//public
//    System.out.println(p.b);//protected
//    System.out.println(p.c);//defaule
//    System.out.println(p.d);//private

}
    public static void main1(String[] args) {
    //重载
        B p=new B();
        p=new B("张三",18);
    }
}
